package com.lzc.springboot.controller;

import com.lzc.springboot.domain.ShowDisease;
import com.lzc.springboot.service.DiseaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/disease")
public class DiseaseController {

  @Autowired
  private DiseaseService diseaseService;

  @RequestMapping(value = "/findDisByCropId",method = RequestMethod.GET)
  public ShowDisease[] findDisByCropId(@RequestParam("cropId") int cropId){
    return diseaseService.findDisByCropId(cropId);
  }

  @RequestMapping(value = "/findDisByText",method = RequestMethod.GET)
  public ShowDisease[] findDisByText(@RequestParam("text") String text){
    return diseaseService.findDisByText(text);
  }
}
